package com.dy.system.service.impl;

import java.util.List;
import com.dy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dy.system.mapper.WarningMessageMapper;
import com.dy.system.domain.WarningMessage;
import com.dy.system.service.IWarningMessageService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author anps
 * @date 2022-08-03
 */
@Service
public class WarningMessageServiceImpl implements IWarningMessageService{
    @Autowired
    private WarningMessageMapper warningMessageMapper;

    /**
     * 查询设备告警信息
     *
     * @param id 设备告警信息主键
     * @return 设备告警信息
     */
    @Override
    public WarningMessage selectWarningMessageById(Long id) {
        return warningMessageMapper.selectWarningMessageById(id);
    }

    /**
     * 查询设备告警信息列表
     *
     * @param warningMessage 设备告警信息
     * @return 设备告警信息
     */
    @Override
    public List<WarningMessage> selectWarningMessageList(WarningMessage warningMessage) {
        return warningMessageMapper.selectWarningMessageList(warningMessage);
    }

    /**
     * 新增设备告警信息
     *
     * @param warningMessage 设备告警信息
     * @return 结果
     */
    @Override
    public int insertWarningMessage(WarningMessage warningMessage) {
        return warningMessageMapper.insertWarningMessage(warningMessage);
    }

    /**
     * 修改设备告警信息
     *
     * @param warningMessage 设备告警信息
     * @return 结果
     */
    @Override
    public int updateWarningMessage(WarningMessage warningMessage) {
        return warningMessageMapper.updateWarningMessage(warningMessage);
    }

    /**
     * 批量删除设备告警信息
     *
     * @param ids 需要删除的设备告警信息主键
     * @return 结果
     */
    @Override
    public int deleteWarningMessageByIds(Long[] ids) {
        return warningMessageMapper.deleteWarningMessageByIds(ids);
    }

    /**
     * 删除设备告警信息信息
     *
     * @param id 设备告警信息主键
     * @return 结果
     */
    @Override
    public int deleteWarningMessageById(Long id) {
        return warningMessageMapper.deleteWarningMessageById(id);
    }

    @Override
    public List<WarningMessage> selectWarningMessageAllList(Long medicalId) {
        return warningMessageMapper.selectWarningMessageAllList(medicalId);
    }

    @Override
    public Integer selectWarningMessageByMonth(String monthValue) {

        Integer month = warningMessageMapper.selectWarningMessageByMonth(monthValue);
        return month == null ? 0 : month;
    }
}
